{% extends "base.html" %}
{% block title %}Sitemap - {{ block.super }} {% endblock %}
{% block canonical_url %}{{ block.super }}/sitemap/{% endblock %}

{% block content %}
  <div class="post sitemap">
    <h2>Sitemap</h2>
    {% if object_list %}
    <ul>
      {% for object in object_list %}
      	<li><a href="{% url 'detail_post_page' slug=object.slug %}">{{ object.title }}</a> - <i>{{ object.created }}</i></li>
      {% endfor %}
    </ul>
    {% endif %}
  </div>

  <ul class="pagination">
    <li {% if not page_obj.has_previous %}class="disabled"{% endif %}>
      <a {% if page_obj.has_previous %}href="?page={{ page_obj.previous_page_number }}" aria-label="Previous" {% endif %}><span aria-hidden="true">&laquo;</span></a>
    </li>
    <li><a href="?page=1">First</a></li>
    {% for linkpage in page_range %}
    {% ifequal linkpage page_obj.number %}
    <li class="active">
      <a>{{ page_obj.number }}<span class="sr-only">(current)</span></a>
    </li>
    {% else %}
    <li><a href="?page={{ linkpage }}">{{ linkpage }}</a></li>
    {% endifequal %}
    {% endfor %}
    <li><a href="?page={{ page_obj.paginator.num_pages }}">Last</a></li>
    <li {% if not page_obj.has_next %}class="disabled"{% endif %}>
      <a {% if page_obj.has_next %}href="?page={{ page_obj.next_page_number }}" aria-label="Next" {% endif %}><span aria-hidden="true">&raquo;</span></a>
    </li>
  </ul>
{% endblock %}
